package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Integer value = map.put("语文",111);
        System.out.println(value);
        map.put("数学",89);
        map.put("英语",114);

        value = map.replace("语文",124);
        System.out.println(value);

        System.out.println(map);

        int size = map.size();
        System.out.println(size);

        value = map.get("语文");
        System.out.println(value);
        value = map.get("体育");
        System.out.println(value);

        value = map.remove("数学");
        System.out.println(value);
        System.out.println(map);

        boolean ck = map.containsKey("化学");
        boolean cv = map.containsValue(124);
        System.out.println(ck);
        System.out.println(cv);
    }
}
